<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:n="http://java.sun.com/jsf/composite/nemesis"
                template="./../modelo/padrao.xhtml">
    <ui:define name="titulo">Listar Cliente</ui:define>
    <ui:define name="corpo">

        <h:form id="formFiltrar" prependId="false">
            <h:panelGrid columns="3">
                <h:outputLabel value="Nome"/>
                <h:outputLabel value="Cidade"/>
                <h:outputLabel value="Bairro"/>
                <h:inputText value="#{clienteListarControle.nome}" size="50"/>
                <h:selectOneMenu value="#{sessao.cidade}"
                                 converter="conversorCidade"
                                 style="cursor: pointer;">
                    <f:ajax render="bairros"/>
                    <f:selectItem itemValue="#{null}" itemLabel="Selecione"/>
                    <f:selectItems value="#{sessao.cidades}"
                                   var="cidade"
                                   itemLabel="#{cidade.nome}"
                                   itemValue="#{cidade}"/>
                </h:selectOneMenu>
                <h:selectOneMenu id="bairros"
                                 value="#{sessao.bairro}"
                                 converter="conversorBairro"
                                 style="cursor: pointer;">
                    <f:selectItem itemValue="#{null}" itemLabel="Selecione"/>
                    <f:selectItems value="#{sessao.bairros}"
                                   var="bairro"
                                   itemLabel="#{bairro.nome}"
                                   itemValue="#{bairro}"/>
                </h:selectOneMenu>
            </h:panelGrid>
            <n:barraListar controle="#{clienteListarControle}"/>
        </h:form>

        <h:form id="formListar" >
            <n:tabela controle="#{clienteListarControle}" navegacao="/cliente/editar.xhtml">
                <p:column width="500">
                    <f:facet name="header">
                        <h:outputText value="Nome"/>
                    </f:facet>
                    <h:outputText value="#{objeto.nome}"/>
                </p:column>
            </n:tabela>
        </h:form>
        
    </ui:define>
</ui:composition>
